const { defineConfig } = require("@vue/cli-service");
const path = require('path')
const resolve = (dir) => {
  return path.resolve(__dirname, dir)
}
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    port: 8081,
    headers: {
      "Access-Control-Allow-Origin": "*", // 主应用获取子应用时跨域响应头
    },
  },
  configureWebpack: {
    resolve: {
      alias: {
        '@': resolve('src')
      }
    },
    output: {
      library: `vue2`,
      libraryTarget: "umd", // 为了让各种规范的模块可以通用，在不同的环境下都可以正常运行，就出现了umd这个通用格式
    },
  },
});
